<?php if (!defined('THINK_PATH')) exit();?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

<!-- Viewport Metatag -->
<meta name="viewport" content="width=device-width,initial-scale=1.0">

<!-- Plugin Stylesheets first to ease overrides -->
<link rel="stylesheet" type="text/css" href="/Public/admin/plugins/colorpicker/colorpicker.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/custom-plugins/wizard/wizard.css" media="screen">

<!-- Required Stylesheets -->
<link rel="stylesheet" type="text/css" href="/Public/admin/bootstrap/css/bootstrap.min.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/css/fonts/ptsans/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/css/fonts/icomoon/style.css" media="screen">

<link rel="stylesheet" type="text/css" href="/Public/admin/css/mws-style.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/css/icons/icol16.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/css/icons/icol32.css" media="screen">

<!-- Demo Stylesheet -->
<link rel="stylesheet" type="text/css" href="/Public/admin/css/demo.css" media="screen">

<!-- jQuery-UI Stylesheet -->
<link rel="stylesheet" type="text/css" href="/Public/admin/jui/css/jquery.ui.all.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/jui/jquery-ui.custom.css" media="screen">

<!-- Theme Stylesheet -->
<link rel="stylesheet" type="text/css" href="/Public/admin/css/mws-theme.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/css/themer.css" media="screen">
<link rel="stylesheet" type="text/css" href="/Public/admin/css/login.css" media="screen">
<script src="/Public/admin/js/libs/jquery-1.8.3.min.js"></script>

<link rel="stylesheet" type="text/css" href="/Public/admin/css/xcConfirm.css"/>
<script src="/Public/admin/js/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/admin/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css">
    .sgBtn{width: 135px; height: 35px; line-height: 35px; margin-left: 10px; margin-top: 10px; text-align: center; background-color: #0095D9; color: #FFFFFF; float: left; border-radius: 5px;}
</style>

	<style>
		td{
			font-size:10px;
		}
		th{
			font-size:10px;
		}
		.grid_4{
			display:none;
		}
	</style>



<title>后台管理</title>

</head>

<body>


    
    <!-- Header -->
<div id="mws-header" class="clearfix" style='background:url(/Public/admin/images/head.png) no-repeat ;min-width:780px;background-size:cover;'>
    
        <!-- Logo Container -->
        <div id="mws-logo-container">
        
            <!-- Logo Wrapper, images put within this wrapper will always be vertically centered -->
           <div id="mws-logo-wrap">
                <a style='font-size:18px;color:black;'></a>
            </div>
       
        </div>
        
        <!-- User Tools (notifications, logout, profile, change password) -->
        <div id="mws-user-tools" class="clearfix">
        <div id="mws-user-message" class="mws-dropdown-menu">
            <a href="#" data-toggle="dropdown" style='font-size:20px;margin-right:10px' ><i class="icol32-arrow-rotate-clockwise" onclick='return new_redirect()' title='刷新'></i></a>
         
        </div>
         <div id="mws-user-message" class="mws-dropdown-menu">
            <a href="/admin.php/home/login"  style='font-size:20px;margin-right:10px' target="_blank"><i class="icol32-drive-user" title='前台'></i></a>
        </div>
            <!-- Notifications -->
            <div id="mws-user-notif" class="mws-dropdown-menu">
               
               
            </div>
            
            <!-- Messages -->
            <div id="mws-user-message" class="mws-dropdown-menu">
               
                
                <!-- Messages dropdown -->
                <div class="mws-dropdown-box">
                    <div class="mws-dropdown-content">
      
                        <div class="mws-dropdown-viewall">
                            <a href="#">View All Messages</a>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- User Information and functions section -->
            <div id="mws-user-info" class="mws-inset">
            
                <!-- User Photo -->
                <div id="mws-user-photo" >
                    <img src="/Public/home/images/photo_1.jpg" alt="User Photo" >
                </div>
                
                <!-- Username and Functions -->
                <div id="mws-user-functions">
                    <div id="mws-username" style='color:#fff;font-size:18px;margin-right:30px;margin-left:15px'>
                        Hello, <?php echo $_SESSION['admin']['user_name']?>
                    </div>
                    <ul>                        
                        <li><a href="/admin.php/Admin/login/loginout" style='font-size:13px;margin-left:15px;margin-top:23px'> 退出登录</a></li>
                    </ul>
                </div>
            </div>
           
        </div>
    </div>
    <script>
        function new_redirect(){ 
            window.location.reload();
        };

    </script>
    <!-- Start Main Wrapper -->
    <div id="mws-wrapper">
    
        <!-- Necessary markup,do not remove -->
        <div id="mws-sidebar-stitch" ></div>
        <div id="mws-sidebar-bg"style='background:#ECECEC;'></div>
        
        <!-- Sidebar Wrapper -->
        <div id="mws-sidebar" style='background:#ECECEC;'>
        
            <!-- Hidden Nav Collapse Button -->
            <div id="mws-nav-collapse">
                <span></span>
                <span></span>
                <span></span>
            </div>
            

            
            <!-- Main Navigation -->
            <div id="mws-navigation">
                <ul>
                <?php if(in_array('article',$_SESSION['node_con'])): ?><li>
                        <a href="/admin.php/Admin/article/index" style='color:black'><span style='font-size:18px'><i class="icol32-page-white-paint"></i></span>&nbsp; &nbsp;信息管理</a>
                        <ul class="closed">
                            <li><a href="/admin.php/Admin/article/index">系统公告列表</a></li>
                            <li><a href="/admin.php/Admin/article/add">系统公告添加</a></li>
                        </ul>
                    </li><?php endif; ?>
                <?php if(in_array('role',$_SESSION['node_con'])): ?><li>
                        <a href="/admin.php/Admin/role/index" style='color:black'><span style='font-size:18px'><i class="icol32-lock-break"></i></span>   &nbsp;&nbsp;权限管理</a>
                        <ul class="closed">
                            <li><a href="/admin.php/Admin/role/index">管理员列表</a></li>
                            <li><a href="/admin.php/Admin/role/admin_log">管理员日志</a></li>
                            <li><a href="/admin.php/Admin/role/index_role">角色管理</a></li>
                        </ul>
                    </li><?php endif; ?>
                <?php if(in_array('system',$_SESSION['node_con'])): ?><li>
                        <a href="/admin.php/Admin/system/set" style='color:black'><span style='font-size:18px'><i class="icol32-car"></i></span>   &nbsp;&nbsp;系统设置</a>
                        <ul class="closed">
                            <li><a href="/admin.php/Admin/system/set">系统设置</a></li>
                            <li><a href="/admin.php/Admin/system/param">参数管理</a></li>
                        </ul>
                    </li><?php endif; ?>
                <?php if(in_array('first',$_SESSION['node_con'])): ?><li>
                        <a href="/admin.php/Admin/first/index" style='color:black'><span style='font-size:18px'><i class="icol32-directory-listing"></i></span>   &nbsp;&nbsp;首页管理</a>
                        <ul class="closed">
                            <li><a href="/admin.php/Admin/first/index">广告管理</a></li>
                            <li><a href="/admin.php/Admin/first/company">公司管理</a></li>
                            
                        </ul>
                    </li><?php endif; ?>
                <?php if(in_array('caiwu',$_SESSION['node_con'])): ?><li>
                        <a href="/admin.php/Admin/caiwu/chongzhi" style='color:black'><span style='font-size:18px'><i class="icol32-set-security-question"></i></span> &nbsp; &nbsp;财务管理</a>
                        <ul class="closed">
                            <li><a href="/admin.php/Admin/caiwu/chongzhi">充值管理</a></li>
                            <li><a href="/admin.php/Admin/caiwu/zijin">资金管理</a></li>
                            <li><a href="/admin.php/Admin/caiwu/shangjia">上市股权上架</a></li>
                        </ul>
                    </li><?php endif; ?>
                <?php if(in_array('user',$_SESSION['node_con'])): ?><li>
                        <a href="/admin.php/Admin/user/pprg" style='color:black'><span style='font-size:18px'><i class="icol32-group"></i></span>   &nbsp;&nbsp;会员管理</a>
                        <ul class="closed">
                            <?php if(in_array('pprg',$_SESSION['node_act'])): ?><li><a href="/admin.php/Admin/user/pprg">匹配认购积分</a></li><?php endif; ?>
                             <?php if(in_array('ppejf',$_SESSION['node_act'])): ?><li><a href="/admin.php/Admin/user/ppejf">匹配E积分</a></li><?php endif; ?>
                             <?php if(in_array('add',$_SESSION['node_act'])): ?><li><a href="/admin.php/Admin/user/add">推荐关系</a></li><?php endif; ?>
                             <?php if(in_array('organization',$_SESSION['node_act'])): ?><li><a href="/admin.php/Admin/user/organization?user_name=001">组织结构</a></li><?php endif; ?>
                             <?php if(in_array('index',$_SESSION['node_act'])): ?><li><a href="/admin.php/Admin/user/index">会员列表</a></li><?php endif; ?>
                            <?php if(in_array('jibie',$_SESSION['node_act'])): ?><li><a href="/admin.php/Admin/user/jibie">会员级别</a></li><?php endif; ?>
                        </ul>
                    </li><?php endif; ?>
                <?php if(in_array('check',$_SESSION['node_con'])): ?><li>
                        <a href="/admin.php/Admin/check/chaifen" style='color:black'><span style='font-size:18px'><i class="icol32-plugin-add"></i></span> &nbsp;&nbsp;拆分与审核</a>
                        <ul class="closed">
                            <li><a href="/admin.php/Admin/check/chaifen">拆分</a></li>
                            <li><a href="/admin.php/Admin/check/shenhe">审核</a></li>
                        </ul>
                    </li><?php endif; ?>
                </ul>
            </div>         
        </div>
        
        <!-- Main Container Start -->
        <div id="mws-container" class="clearfix">
            <div class="container" class="clearfix">
                <?php if($_session['success'] == true): ?><div class="mws-form-message success">
                    <ul>
                        <?php echo ($_session['success']); ?>
                    </ul>
                </div>
                <?php elseif($_session['error'] == true): ?>
                <div class="mws-form-message error">
                    <ul>
                        <?php echo ($_session['error']); ?>
                    </ul>
                </div><?php endif; ?>
                    
<div class="mws-panel grid_8" style="min-width:925px">
	<div class="mws-panel-header">
		<span><i class="icon-table"></i>管理中心-会员列表</span>
	</div>
	<div class="mws-panel-body no-padding">
		<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
			<form action="/admin/user/index" method="get">
				<div id="DataTables_Table_1_length" class="dataTables_length">
					<label>显示 
					<select size="1" name="num" aria-controls="DataTables_Table_1">
						<option value="10" <?php if($num == 10): ?>selected<?php endif; ?>>10</option>
						<option value="25" <?php if($num == 25): ?>selected<?php endif; ?>>25</option>
						<option value="50" <?php if($num == 50): ?>selected<?php endif; ?>>50</option>
						<option value="100" <?php if($num == 100): ?>selected<?php endif; ?>>100</option>
					</select> 页
				</label>
				</div>
					<div class="dataTables_filter" id="DataTables_Table_1_filter"><label>搜索用户名: <input aria-controls="DataTables_Table_1" name="username" type="text"></label>
					<label>搜索ID: <input aria-controls="DataTables_Table_1" name="userid" type="text"></label>
					<label>搜索真实姓名: <input aria-controls="DataTables_Table_1" name="truename" type="text"></label>
					<label> VIP等级 
						<select size="1" name="user_type" aria-controls="DataTables_Table_1">
							<option value="">搜索等级</option>
							<option value="3" <?php if($user_type == 3): ?>selected<?php endif; ?>>VIP1</option>
							<option value="5" <?php if($user_type == 5): ?>selected<?php endif; ?>>VIP2</option>
							<option value="10" <?php if($user_type == 10): ?>selected<?php endif; ?>>VIP3</option>
							<option value="30" <?php if($user_type == 30): ?>selected<?php endif; ?>>VIP4</option>
							<option value="50" <?php if($user_type == 50): ?>selected<?php endif; ?>>VIP5</option>
							<option value="100" <?php if($user_type == 100): ?>selected<?php endif; ?>>VIP6</option>
						</select>
					</label>
					<input type="submit" value="提交" class="btn btn-primary">
				</div>
			</form>			
			<table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info" >
			    <thead>
			        <tr role="row" >
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" width="30px" >中心
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="Browser: activate to sort column ascending" >ID号
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="Platform(s): activate to sort column ascending">用户名
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="Engine version: activate to sort column ascending">等级
				        </th>
				       
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">姓名
				        </th>
				      
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending" >积分
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">奖励
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">E积分
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">小区业绩
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">出局
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">注册时间
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending" width="30px">操作
				        </th>
			        </tr>
			    </thead>
				<tbody role="alert" aria-live="polite" aria-relevant="all">
				<?php if(is_array($res)): $i = 0; $__LIST__ = $res;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="odd">
			            <td class="">
			            	<?php if($vo["is_reportcenter"] == true): ?><img class="baodan" name="<?php echo ($vo["is_reportcenter"]); ?>" src="/Public/yes.gif" alt="">
			            	<?php else: ?>
			            		<img class="baodan" name="<?php echo ($vo["is_reportcenter"]); ?>" src="/Public/no.gif" alt=""><?php endif; ?>
			            </td>
			            <td class=""><?php echo ($vo["user_id"]); ?></td>
			            <td class=""><?php echo ($vo["user_name"]); ?></td>
			            <td class=""><?php echo ($vo["name"]); ?></td>
			          
			            <td class=""><?php echo ($vo["true_name"]); ?></td>
			            <td class=" ">
			            	现金积分：<?php echo ($vo["user_money1"]); ?><br>
			            	注册积分：<?php echo ($vo["user_money2"]); ?><br>
			            	认购积分：<?php echo ($vo["user_money3"]); ?><br>
			            	商城积分：<?php echo ($vo["user_money4"]); ?><br>
			            	上市股权：<?php echo ($vo["user_money"]); ?><br>
			            	慈善积分：<?php echo ($vo["cishan_money"]); ?><br>
			            	动态扣税：<?php echo ($vo["dongtaikoushui_money"]); ?>
			            </td>
			            <td class=" ">
			            	销售奖：<?php echo ($vo["pay_points1"]); ?><br>
			            	平衡奖：<?php echo ($vo["pay_points2"]); ?><br>
			            	管理奖：<?php echo ($vo["pay_points3"]); ?><br>
			            	交易奖：<?php echo ($vo["pay_points4"]); ?><br>
							服务奖：<?php echo ($vo["pay_points5"]); ?>
			            </td>
			            <td class=" "><?php echo ($vo["option_num"]); ?></td>
			            
			            <td class=" "><?php echo ($vo["left_num"]); ?></td>
			            
			            <td class=" ">
			            	<?php if($vo["is_out"] == true): ?><img src="/Public/yes.gif" alt="">
			            	<?php else: ?>
			            		<img src="/Public/no.gif" alt=""><?php endif; ?>
			            </td>
			            <td class=" "><?php echo date('Y-m-d H:i:s',$vo['reg_time']);?></td>
			            <td>
			            	<a href="/admin/user/chakan?aa=<?php echo ($vo["user_id"]); ?>&bb=<?php echo ($vo["inviter_id"]); ?>&cc=<?php echo ($vo["tree_id"]); ?>&dd=<?php echo ($vo["report_user_id"]); ?>" title="查看"><font class="caozuo" style="color:#000">查看</font></a>
			            	<a href="/admin.php/home/login/dologin/ad_us_id/<?php echo ($vo["user_id"]); ?>" title="前台" target="_blank"><font class="caozuo" style="color:#000">前台</font></a>
			            	<a href="/admin/user/bianji?aa=<?php echo ($vo["user_id"]); ?>" title="编辑"><font class="caozuo" style="color:#000">编辑</font></a>
			            	<a href="/admin/user/mingxi?aa=<?php echo ($vo["user_id"]); ?>&bb=<?php echo ($vo["user_name"]); ?>" title="明细"><font class="caozuo" style="color:#000">明细</font></a>
			            	<?php if($vo["is_jh"] == 0): ?><a href="/admin.php/Admin/user/dongjie?aa=<?php echo ($vo["user_id"]); ?>" title="冻结"><font class="caozuo" style="color:#000">冻结</font></a>
			            	<?php else: ?>
			            		<a href="/admin.php/Admin/user/jiedong?aa=<?php echo ($vo["user_id"]); ?>" title="取消冻结"><font class="caozuo" style="color:#000">取消冻结</font></a><?php endif; ?>
			            </td>
			        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
				</tbody>
			</table>
			<div class="dataTables_info" id="DataTables_Table_1_info">总计:<?php echo ($count); ?></div>
			<div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_1_paginate">
				<?php echo ($url); ?>
			</div>
		</div>
    </div>
</div>

<script>
 	$.ajaxSetup({
         headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
         }
    });
	$('.caozuo').mouseover(function(){
		$(this).css('cursor','pointer');
		$(this).css('color','red');
	}).mouseout(function(){
		$(this).css('color','#000')
	});

	$('.baodan').click(function(){
		var baodan_id = $(this).parent().next().text();
		var baodan = $(this).attr('name');
		var i = $(this).parent().parent().index();
		$.ajax({
		   type: "POST",
		   url: "/admin/user/baodan",
		   data: {user_id:baodan_id,is_reportcenter:baodan},
		   async: false,
		   success: function(str){
		     if(str == 1){
		     	if(baodan == 1){
		     		$('.baodan').eq(i).attr('src','/Public/no.gif');
		     		$('.baodan').eq(i).attr('name',0);
		     		alert('切换成功');
		     	}else{
		     		$('.baodan').eq(i).attr('src','/Public/yes.gif');
		     		$('.baodan').eq(i).attr('name',1);
		     		alert('切换成功');
		     	}
		     }else{
		     	alert('切换失败');
		     }
		   }
		});
	});
</script>

            </div>
        </div>
            <!-- Inner Container End -->

            
            
    </div>
        <!-- Main Container End -->
        
</div>

    <!-- JavaScript Plugins -->
    
    <script src="/Public/admin/js/libs/jquery.mousewheel.min.js"></script>
    <script src="/Public/admin/js/libs/jquery.placeholder.min.js"></script>
    <script src="/Public/admin/custom-plugins/fileinput.js"></script>
    
    <!-- jQuery-UI Dependent Scripts -->
    <script src="/Public/admin/jui/js/jquery-ui-1.9.2.min.js"></script>
    <script src="/Public/admin/jui/jquery-ui.custom.min.js"></script>
    <script src="/Public/admin/jui/js/jquery.ui.touch-punch.js"></script>

    <!-- Plugin Scripts -->
    <script src="/Public/admin/plugins/datatables/jquery.dataTables.min.js"></script>
    <!--[if lt IE 9]>
    <script src="js/libs/excanvas.min.js"></script>
    <![endif]-->
     <script src="/Public/admin/plugins/flot/jquery.flot.min.js"></script>
    <script src="/Public/admin/plugins/flot/plugins/jquery.flot.tooltip.min.js"></script>
    <script src="/Public/admin/plugins/flot/plugins/jquery.flot.pie.min.js"></script>
    <script src="/Public/admin/plugins/flot/plugins/jquery.flot.stack.min.js"></script>
    <script src="/Public/admin/plugins/flot/plugins/jquery.flot.resize.min.js"></script>
    <script src="/Public/admin/plugins/colorpicker/colorpicker-min.js"></script>
    <script src="/Public/admin/plugins/validate/jquery.validate-min.js"></script>
    <script src="/Public/admin/custom-plugins/wizard/wizard.min.js"></script>

    <!-- Core Script -->
    <script src="/Public/admin/bootstrap/js/bootstrap.min.js"></script>
    <script src="/Public/admin/js/core/mws.js"></script>

    <!-- Themer Script (Remove if not needed) -->
    <script src="/Public/admin/js/core/themer.js"></script>

    <!-- Demo Scripts (remove if not needed) -->
    <script src="/Public/admin/js/demo/demo.dashboard.js"></script>
    

</body>
</html>